<?php


			 $id=!empty($_GET['id'])?$_GET['id']:'';
		/*include_once('init.php');*/
		if (!empty($_POST)) {
			
		
		$where['news']=$_POST['news'];
		$where['pid']=$_POST['pid'];
		
		$row=edit('cate',$where,$_GET['id']);
        if ($row>=0) {
        	echo '<script>alert("编辑成功");location.href="index.php?c=cate&a=news&admin=1";</script>';

        }else{
        	echo '<script>alert("编辑失败");history.go(-1);</script>';die;
        }
		
    }
		

	      
		$rows=getselectByone('cate',"`id`='$id'");
		$cate=caedit($rows);
	
	

			$cate=array_reverse($cate,true);
   if (!empty($_SERVER['HTTP_X_REQUESTED_WITH'])) {

        if (!empty($cate)) {
        	echo json_encode($cate);die;
        }else{
        	echo 0;
        }
        	

        	
        	
        }
	   include( VIEW_PATH.$admin.'layst.html');



?>
